<?php

// 订单管理
\Breadcrumbs::register('order', function($breadcrumbs, $type, $u = 0)
{
    $breadcrumbs->push('首页', route('admin.index'));
    $url = $u ? url('admin/order/manager') : route('admin.order.index', ['type' => $type]);

    if ($u == 1) {
    	$url  = url('admin/order/manager');
    	$name = '订单管理'; 
    } else {
    	$url = route('admin.order.index', ['type' => $type]);
    	$name = ['网站订单', '通用订单'][$type-1];
    }

    $breadcrumbs->push($name, $url);
});

// 订单编辑
\Breadcrumbs::register('order-edit', function($breadcrumbs, $data, $u)
{
	$breadcrumbs->parent('order', $data->type, $u);
	$breadcrumbs->push(['更新网站', '更新通用订单'][$data->type-1]);
});

// 查看订单
\Breadcrumbs::register('order-show', function($breadcrumbs, $data, $u = 0)
{
	$breadcrumbs->parent('order', $data->type, $u);
	$breadcrumbs->push('查看订单');
});

// 添加网站
\Breadcrumbs::register('order-create', function($breadcrumbs, $type)
{
	$breadcrumbs->parent('order', $type);
	$breadcrumbs->push(['添加网站', '添加通用订单'][$type-1]);
});

// 客户管理
\Breadcrumbs::register('customer', function($breadcrumbs)
{
	$breadcrumbs->push('首页', route('admin.index'));
	$breadcrumbs->push('客户管理', route('admin.customer.index'));
});

// 修改客户信息
\Breadcrumbs::register('customer-edit', function($breadcrumbs)
{
	$breadcrumbs->parent('customer');
	$breadcrumbs->push('修改客户信息');
});

// 客户详细
\Breadcrumbs::register('admin.customer.show', function($breadcrumbs)
{
	$breadcrumbs->parent('customer');
	$breadcrumbs->push('客户相关订单');
});

// 订单管理
\Breadcrumbs::register('order-manager', function($breadcrumbs)
{
	$breadcrumbs->push('首页', route('admin.index'));
	$breadcrumbs->push('订单管理');
});

// 用户管理
\Breadcrumbs::register('user', function($breadcrumbs)
{
	$breadcrumbs->push('首页', route('admin.index'));
	$breadcrumbs->push('用户管理', route('admin.user.index'));
});

// 添加用户
\Breadcrumbs::register('user-create', function($breadcrumbs)
{
	$breadcrumbs->parent('user');
	$breadcrumbs->push('添加用户');
});

// 修改用户
\Breadcrumbs::register('user-edit', function($breadcrumbs)
{
	$breadcrumbs->parent('user');
	$breadcrumbs->push('修改用户');
});

// 用户组管理
\Breadcrumbs::register('group', function($breadcrumbs)
{
	$breadcrumbs->push('首页', route('admin.index'));
	$breadcrumbs->push('用户组管理', route('admin.group.index'));
});

// 添加用户组
\Breadcrumbs::register('group-create', function($breadcrumbs)
{
	$breadcrumbs->parent('group');
	$breadcrumbs->push('添加用户组');
});

// 修改用户组
\Breadcrumbs::register('group-edit', function($breadcrumbs)
{
	$breadcrumbs->parent('group');
	$breadcrumbs->push('修改用户组');
});

// 部门管理
\Breadcrumbs::register('department', function($breadcrumbs)
{
	$breadcrumbs->push('首页', route('admin.index'));
	$breadcrumbs->push('部门管理', route('admin.department.index'));
});

// 添加部门
\Breadcrumbs::register('department-create', function($breadcrumbs)
{
	$breadcrumbs->parent('department');
	$breadcrumbs->push('添加部门');
});

// 修改部门
\Breadcrumbs::register('department-edit', function($breadcrumbs)
{
	$breadcrumbs->parent('department');
	$breadcrumbs->push('修改部门');
});

// 菜单管理
\Breadcrumbs::register('admin.menu.index', function($breadcrumbs)
{
	$breadcrumbs->push('首页', route('admin.index'));
	$breadcrumbs->push('菜单管理', route('admin.menu.index'));
});

// 菜单添加
\Breadcrumbs::register('admin.menu.create', function($breadcrumbs)
{
	$breadcrumbs->parent('admin.menu.index');
	$breadcrumbs->push('添加菜单');
});

// 修改菜单
\Breadcrumbs::register('admin.menu.edit', function($breadcrumbs)
{
	$breadcrumbs->parent('admin.menu.index');
	$breadcrumbs->push('修改菜单');
});

// 个人资料
\Breadcrumbs::register('edit-info', function($breadcrumbs)
{
	$breadcrumbs->push('首页', route('admin.index'));
	$breadcrumbs->push('个人资料');
});

// 订单进度
\Breadcrumbs::register('progress-tongji', function($breadcrumbs)
{
	$breadcrumbs->push('首页', route('admin.index'));
	$breadcrumbs->push('订单进度');
});

// 其他订单
\Breadcrumbs::register('admin.other-order.index', function($breadcrumbs)
{
	$breadcrumbs->push('首页', route('admin.index'));
	$breadcrumbs->push('其他订单', route('admin.other-order.index'));
});

// 添加其他订单
\Breadcrumbs::register('admin.other-order.create', function($breadcrumbs)
{
	$breadcrumbs->parent('admin.other-order.index');
	$breadcrumbs->push('添加其他订单');
});

// 修改其他订单
\Breadcrumbs::register('admin.other-order.edit', function($breadcrumbs)
{
	$breadcrumbs->parent('admin.other-order.index');
	$breadcrumbs->push('修改其他订单');
});

// 合同管理
\Breadcrumbs::register('admin.contract.index', function($breadcrumbs)
{
	$breadcrumbs->push('首页', route('admin.index'));
	$breadcrumbs->push('合同管理', route('admin.contract.index'));
});

// 查看合同
\Breadcrumbs::register('admin.contract.show', function($breadcrumbs)
{
	$breadcrumbs->parent('admin.contract.index');
	$breadcrumbs->push('查看合同');
});

// 添加合同
\Breadcrumbs::register('admin.contract.create', function($breadcrumbs)
{
	$breadcrumbs->parent('admin.contract.index');
	$breadcrumbs->push('添加合同');
});

// 修改合同
\Breadcrumbs::register('admin.contract.edit', function($breadcrumbs)
{
	$breadcrumbs->parent('admin.contract.index');
	$breadcrumbs->push('修改合同');
});

// 续费记录
\Breadcrumbs::register('admin.renew.index', function($breadcrumbs)
{
	$breadcrumbs->push('首页', route('admin.index'));
	$breadcrumbs->push('续费记录', route('admin.renew.index'));
});

// 添加续费
\Breadcrumbs::register('admin.renew.create', function($breadcrumbs)
{
	$breadcrumbs->parent('admin.renew.index');
	$breadcrumbs->push('添加续费');
});

// 修改续费
\Breadcrumbs::register('admin.renew.edit', function($breadcrumbs)
{
	$breadcrumbs->parent('admin.renew.index');
	$breadcrumbs->push('修改续费');
});

// 语言版本
\Breadcrumbs::register('admin.lan-complete.index', function($breadcrumbs, $type, $order_id=0)
{
	// $breadcrumbs->push('首页', route('admin.index'));
	$breadcrumbs->parent('order', $type);
	$breadcrumbs->push('语言版本', route('admin.lan-complete.index', ['order_id'=>$order_id]));
});

// 添加语言版本
\Breadcrumbs::register('admin.lan-complete.create', function($breadcrumbs, $type, $order_id)
{
	$breadcrumbs->parent('admin.lan-complete.index', $type, $order_id);
	$breadcrumbs->push('添加语言版本');
});

// 修改言版本
\Breadcrumbs::register('admin.lan-complete.edit', function($breadcrumbs, $type, $order_id)
{
	$breadcrumbs->parent('admin.lan-complete.index', $type, $order_id);
	$breadcrumbs->push('修改合同');
});

// 更新言版本
\Breadcrumbs::register('admin.lan-complete.progress', function($breadcrumbs, $type, $order_id)
{
	$breadcrumbs->parent('admin.lan-complete.index', $type, $order_id);
	$breadcrumbs->push('更新进度');
});

// 其他订单
\Breadcrumbs::register('admin.reply.index', function($breadcrumbs)
{
	$breadcrumbs->push('首页', route('admin.index'));
	$breadcrumbs->push('订单回复', route('admin.reply.index'));
});

// 客户笔记
\Breadcrumbs::register('admin.customer-note.index', function($breadcrumbs, $cid)
{
	$breadcrumbs->parent('customer');
	$breadcrumbs->push('笔记', route('admin.customer-note.index', ['cid'=>$cid]));
});

// 笔记添加
\Breadcrumbs::register('admin.customer-note.create', function($breadcrumbs, $cid)
{
	$breadcrumbs->parent('admin.customer-note.index', $cid);
	$breadcrumbs->push('添加笔记');
});

// 笔记编辑
\Breadcrumbs::register('admin.customer-note.edit', function($breadcrumbs, $cid)
{
	$breadcrumbs->parent('admin.customer-note.index', $cid);
	$breadcrumbs->push('重新编辑');
});

